/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-04-04
 * Time: 21:27
 */
public class Training_0404 {

    /**
     * 一次可以跳一个台阶 也可以一次两个台阶, 也可以n个台阶 问跳上第 n级台阶总共有多少种方法
     *
     * @param number n 级台阶
     * @return 返回方法总数
     */
    public static int jumpFloorII (int number) {
        // write code here
        // f(n) = f(0) + f(1) + f(2) + ... + f(n-1) + f(n);
        // f(n-1) = f(0) + f(1) + f(2) + .. + f(n-2) + f(n-1);
        if(number <= 0) {
            return -1;
        }
        else if(number == 1) {
            return 1;
        }
        else {
            return 2*jumpFloorII(number - 1);
        }
    }
    public static void main(String[] args) {
        String s1 = "abc" + "d";
        System.out.println(s1);
        System.out.println();
    }
}
